package test01;

// Anthropic适配器
public class AnthropicAdapter implements UnifiedAIService {
    private AnthropicClient anthropicClient;

    public AnthropicAdapter(AnthropicClient anthropicClient) {
        this.anthropicClient = anthropicClient;
    }

    @Override
    public String generateText(String prompt) {
        // 将统一请求转换为Anthropic特定格式
        MessageRequest request = convertToAnthropicRequest(prompt);

        // 调用原生Anthropic客户端
        MessageResponse response = anthropicClient.createMessage(request);

        // 将Anthropic响应转换为统一格式
        return response.getContent();
    }

    private MessageRequest convertToAnthropicRequest(String prompt) {
        // 实现请求格式转换逻辑
        return new MessageRequest(prompt);
    }
}
